<div class="row">
    <div class="col-md-12">
        <div class="box-widget">
            <br />
            <div class="col-lg-4">
                <input id="filter" placeholder="Tìm kiếm" class="form-control" />
            </div>
            <br />
            <hr />
            <table data-filter="#filter" id="list-group" class="footable table data-tbl-boxy responsive">
                <thead>
                    <tr>
                        <th data-type="numeric">
                            <?php echo $this->translate('id'); ?>
                        </th>
                        <th>
                            <?php echo $this->translate('customer name'); ?>
                        </th>
                        <th data-type="date">
                            <?php echo $this->translate('date'); ?>
                        </th>
                        <th data-type="numeric">
                            <?php echo $this->translate('subtotal'); ?>
                        </th>
                        <th data-type="numeric">
                            <?php echo $this->translate('dept'); ?>
                        </th>
                        <th data-type="numeric">
                            <?php echo $this->translate('totalpaid'); ?>
                        </th>
                        <th data-type="numeric">
                            <?php echo $this->translate('Trả hàng'); ?>
                        </th>
                        <th data-type="numeric">
                            <?php echo $this->translate('remaining'); ?>
                        </th>
                        <th>
                            <?php echo $this->translate('In'); ?>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($this->data as $row): ?>
                    <tr>
                        <td data-value="<?php echo $row->id; ?>">
                            <?php echo $row->id; ?>
                        </td>
                        <td>
                            <a target="_blank" href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'sales-invoice', 'action' => 'view', 'order_id' => $row->id), null, true); ?>" id="viewdetail"  title="<strong><?php echo $this->translate('In Hóa Đơn'); ?></strong>">
                                <?php echo $row->name; ?>
                            </a>
                        </td>
                        <td data-value="<?php echo strtotime($row->date); ?>">
                            <?php echo date("h:i:s", strtotime($row->date)); ?><br />
                            <?php echo date("d-m-Y", strtotime($row->date)); ?>
                        </td>
                        <td data-value="<?php echo $row->subtotal; ?>">
                            <?php echo number_format($row->subtotal, 0, null, "."); ?>
                        </td>
                        <td data-value="<?php echo $row->dept; ?>">
                            <?php echo number_format($row->dept, 0, null, "."); ?>
                        </td>
                        <td data-value="<?php echo $row->totalpay; ?>">
                            <?php echo number_format($row->totalpay, 0, null, "."); ?>
                        </td>
                        <td data-value="<?php echo $row->refund; ?>">
                            <?php echo number_format($row->refund, 0, null, "."); ?>
                        </td>
                        <td data-value="<?php echo $row->remaining; ?>">
                            <?php echo number_format($row->remaining, 0, null, "."); ?>
                        </td>
                        <td>
                            <a target="_blank" href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'sales-invoice', 'action' => 'view', 'order_id' => $row->id), null, true); ?>" id="viewdetail"  title="<strong><?php echo $this->translate('In Hóa Đơn'); ?></strong>" class="btn btn-mini btn-primary">
                                <?php echo $this->translate('In hóa đơn'); ?>
                            </a><br />
                            <a target="_blank" class="btn btn-mini btn-info" href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'customer', 'action' => 'print', 'id' => $row->customer_id), null, true); ?>">In địa chỉ</a>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                </tbody>
                <tfoot>
                     <tr>
						<td colspan="11">
							<ul class="pagination pagination-sm"></ul>
						</td>
					</tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>
<script>
function viewPrint(id){
    window.open('<?php echo $this->url(array('module' => 'default', 'controller' => 'sales-invoice', 'action' => 'view'), null, true); ?>/order_id/' + id, 'Chi tiết', 'scrollbars=1,width=1024,height=768');
}

$(document).ready(function(){
    $("tbody tr").mouseover(function(){
        $(this).addClass("hover");
    });
    
    $("tbody tr").mouseout(function(){
        $(this).removeClass("hover");
    });
});
</script>
<style>
tbody tr.hover{
    background-color: #D5D5FF !important;
}

tbody tr.hover td{
    
}
</style>